# x86_64-w64-mingw32-gcc ms-rprn_c.c ms-rprn_s.c system_printspoofer.c -o system_printspoofer.exe -lrpcrt4 -luserenv -w

CC=x86_64-w64-mingw32-gcc

CHECK_SOURCES=check.c
# EXPLOIT_SOURCES=exploit.c
EXPLOIT_SOURCES=ms-rprn_c.c ms-rprn_s.c exploit.c
# EXPLOIT_SOURCES=base64.c callback.c exploit.c

CHECK_OUTFILE=../../check.exe
EXPLOIT_OUTFILE=../../exploit.exe

# COMPILE_FLAG=-lwinhttp -Wl,-Bstatic -Wl,--pic-executable,-e,main -w
COMPILE_FLAG=-Wl,--pic-executable,-e,main -w

x64: check_x64 exploit_x64
x64_debug: printspoofer_64_check printspoofer_64_exploit

check_x64:
	$(CC) $(CHECK_SOURCES) -o $(CHECK_OUTFILE) $(COMPILE_FLAG)

exploit_x64:
	$(CC) $(EXPLOIT_SOURCES) -o $(EXPLOIT_OUTFILE) $(COMPILE_FLAG) -lrpcrt4 -luserenv